package RegexDemo;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PatterDemo {
	public static void main(String[] args) {
		Pattern pattern=Pattern.compile("a*b");
		Matcher m=pattern.matcher("aaab");
		System.out.println(m.matches());
		System.out.println(Pattern.matches("b*a", "bba"));
		System.out.println(Pattern.matches("[abc]", "d"));
		System.out.println(pattern.pattern());
	}
}
